package py.edu.ucsa.sisale.access.dao;

import java.util.Collection;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import py.edu.ucsa.sisale.access.domain.User;

public interface UserRepository {
	
	@Transactional
    Collection<User> loadUsers();

    @Transactional
    void saveUser(User user);

    @Transactional(readOnly = true)
    String findPasswordByUsername(String username);

    @Transactional(readOnly = true)
    User findUserByUsername(String username);

    List<String> findUsername(String query);

    @Transactional(readOnly = true)
    boolean isEmailAlreadyExists(String email);

    @Transactional(readOnly = true)
    boolean isSecurityCodeValid(String email, String securityCode);

    @Transactional(readOnly = true)
    User findUserByEmail(String email);

    @Transactional
    void update(User user);
}
